<?php
function edits( )
{
				global $db;
				$db->query( "select * from tun2_columns WHERE id=".$_GET['id'] );
				if ( $db->next_record( ) )
				{
								echo "<script language=\"javascript\" src=\"inc/js.js\"></script>\r\n<table width=\"98%\" border=\"1\" align=\"center\" cellpadding=\"5\" cellspacing=\"0\" class=\"table\">\r\n <form action=\"single.php?Action=edit\" method=\"post\" name=\"form\" onSubmit=\"return Validator.Validate(this,3)\">\r\n <input name=\"id\" type=\"hidden\" value=\"";
								echo $db->Record['id'];
								echo "\" />\r\n<input name=\"bid\" type=\"hidden\" value=\" ";
								echo $db->Record['bid'];
								echo "\" />\r\n\r\n  <tr>\r\n    <td align=\"right\" width=\"15%\">标题：</td>\r\n    <td><input name=\"columnsname\" type=\"text\" value=\"";
								echo $db->Record['columnsname'];
								echo "\" size=\"50\" dataType=\"Require\" msg=\"请填栏目名称\"/></td>\r\n  </tr>\r\n <input name=\"hide\" type=\"hidden\" value=\"";
								echo $db->Record['hide'];
								echo "\" /><input name=\"module\" type=\"hidden\" value=\"";
								echo $db->Record['module'];
								echo "\" /><input name=\"turl\" type=\"hidden\" value=\"";
								echo $db->Record['turl'];
								echo "\" />\r\n  <input name=\"description\" type=\"hidden\" value=\"";
								echo $db->Record['description'];
								echo "\" />\r\n <input name=\"keywords\" type=\"hidden\" value=\"";
								echo $db->Record['keywords'];
								echo "\" />\r\n  <tr>\r\n    <td align=\"right\" valign=\"top\">文章内容：</td>\r\n    <td>";
								$oFCKeditor = new FCKeditor('content')  ;
                                $oFCKeditor->BasePath = 'fckeditor/' ;   
                                $oFCKeditor->ToolbarSet = 'Default' ;
                                $oFCKeditor->InstanceName = 'content' ;
                                $oFCKeditor->Width = '100%' ;
                                $oFCKeditor->Height = '400' ;
                                $oFCKeditor->Value  = $db->Record['content'];
                                $oFCKeditor->Create() ;
								echo "</td>\r\n  </tr>\r\n   <input name=\"columnswith\" type=\"hidden\" value=\""; 
								echo $db->Record['columnswith'];
								echo "\" />\r\n<tr>\r\n    <td colspan=\"2\" align=\"center\"><input name=\"url\" type=\"hidden\" value=\"";
								echo $_SERVER['HTTP_REFERER'];
								echo "\"><input type=\"submit\" name=\"Submit_edit\" value=\"修改\" id=\"Submit_edit\" /></td>\r\n  </tr>\r\n </form>\r\n</table>\r\n<br>\r\n";
				}
}



include( "../inc/header2.php" );
login_check( );
echo "\r\n<body>\r\n";
switch ( $_REQUEST['Action'] )
{
case "edits" :
				if(acl_check($_GET['id'],0) || acl_check($_GET['id'],1)){
					edits( );
				}else {
					admin_showerrs( "<li>你无权操作该栏目</li>", null, 0 );
				}
				break;
case "editall" :
				editall( );
				break;
case "edit" :
				if ( function_exists( "date_default_timezone_set" ) )
				{
								date_default_timezone_set( "Hongkong" );
				}
				$addtime = date( "Y-m-d H-i-s" );
				extract( $_POST );

				$db->query( "UPDATE tun2_columns SET bid='".$_POST['bid']."',\r\n\t\tmodule='{$_POST['module']}',\r\n\t\tturl='{$_POST['turl']}',\r\n\t\tcolumnsname='{$_POST['columnsname']}',\r\n\t\thide='{$_POST['hide']}',\r\n\t\tdescription='{$_POST['description']}',\r\n\t\tkeywords='{$_POST['keywords']}',\r\n\t\tcolumnswith='{$_POST['columnswith']}',\r\n\t\tcontent='{$_POST['content']}'  WHERE id={$_POST['id']}" );
				
				addlog( "修改<<".$_POST['columnsname'].">>内容", $_SESSION['user_name'] );
				admin_showerr( "<li>修改内容成功</li>", $_POST['url'], 1 );
				break;

}
?>
